#define DEBUG
#include <cstdio>
#define MAXN 200000
#define HASHT 1000007

using namespace std;

class HashTable {
public:
  int key[HASHT], ver[HASHT];

  bool hash(int k, int v) {
    int i;
    for (i=k%HASHT; ver[i]==v; i=(i+1)%HASHT) {
      if (key[i]==k) {
	return true;
      }
    }
    ver[i]=v;
    key[i]=k;
    return false;
  }
};

int main() {
#ifdef DEBUG
  freopen("4665.in", "r", stdin);
  freopen("4665.out", "w", stdout);
#endif

  static int a[MAXN+1];
  int n, k, d;
  scanf("%d %d %d", &n, &k, &d);
  for (int i=1; i<=n; i++) {
    scanf("%d", a+i);
  }

  static HashTable book;
  int ansl=1, ansr=1;
  for (int i=1, j; i<=n; i++) {
    int first=a[i], last=a[i];
    for (j=i; j<=n; j++) {
      if (a[j]%d!=a[i]%d) {
	i = j-1;
	break;
      }
      if (book.hash(a[j], i)) {
	break;
      }
      if (a[j]<first) {
	first=a[j];
      }
      if (a[j]>last) {
	last=a[j];
      }
      if ((last-first)/d+1<=j-i+1+k) {
	if (ansr-ansl+1<j-i+1) {
	  ansl=i, ansr=j;
	}
      }
    }
  }

  printf("%d %d", ansl, ansr);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
